﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;

namespace SmoothStreaming.PerformanceTesting
{
    public class ChunkResponse
    {
        public Dictionary<string, string> Headers { get; set; }

        public DateTime? RequestedAt { get; set; }
        public DateTime? ResponseCompletedAt { get; set; }
        public HttpStatusCode ReturnStatusCode { get; set; }
        public int ReturnStatusCodeNumeric { get { return (int)ReturnStatusCode; } }

        public TimeSpan? Elapsed
        {
            get
            {
                if (RequestedAt.HasValue && ResponseCompletedAt.HasValue)
                {
                    return ResponseCompletedAt.Value.Subtract(RequestedAt.Value);
                }

                return null;
            }
        }
    }
}
